package com.example.server.service.impl;

import com.example.server.mapper.UserMapper;
import com.example.server.pojo.User;
import com.example.server.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service("UserService")
public class UserServiceImpl implements UserService {
    @Resource
    UserMapper userMapper;
    @Override
    public String identify(String user_name, String user_identify) //证件审核
    {
        User user =userMapper.identify(user_name,user_identify);
        if(user!=null) return "审核通过";
        else return "用户信息错误";
    }
    @Override
    public User getuserinfo(String user_id) //获取用户基础信息
    {
        return userMapper.getuserinfo(user_id);
    }

    @Override
    public String updateuserinfo(String user_tql, String user_id) //更新用户信息
    {// 修改tel
        userMapper.updateuserinfo(user_tql, user_id);
        return "修改成功";
    }
    @Override
    public boolean whiteuser(String user_id) {
        User user = userMapper.getuserinfo(user_id);
        return user.getUser_white().equals("y");
    }
}
